package com.mojo;

import com.mojo.config.Car;
import com.mojo.config.MyConfig;
import com.mojo.config.Person;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringBoot01InitApplication {

    public static void main(String[] args) {
        //ioc容器
        ConfigurableApplicationContext run = SpringApplication.run(SpringBoot01InitApplication.class, args);
        //String applicationName = run.getApplicationName();
        //System.out.println(applicationName);
        //String[] definitionNames = run.getBeanDefinitionNames();
        //for (String name : definitionNames) {
        //    System.out.println(">>>>>:" + name);
        //}
        Person person = run.getBean("person", Person.class);
        MyConfig myConfig = run.getBean("myConfig", MyConfig.class);
        System.out.println(person);
        //Car car = myConfig.getCar();
        //System.out.println("car bean:" + car);
    }

}
